<?php
class admin_logModel extends baseModel{
	protected $table = 'admin_log';


    public function add($data) {
        $loginnum=$this->count();
        if($loginnum>299){
            $this->model->table('admin_log')->where(1)->order('id asc')->limit(1)->delete();
        }
        $log_data['uid']=$data['uid'];
        $log_data['time']=time();
        $log_data['ip']=get_client_ip();
        return $this->insert($log_data);
    }


}